/*******************************************************************************
 * Copyright (c) 2011 LegSem.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl-3.0.txt
 * 
 * Contributors:
 *     LegSem - initial API and implementation
 ******************************************************************************/
package com.legsem.legstar.cci;

import javax.resource.cci.Connection;

import com.legsem.legstar.jca.LegStarManagedConnection;

/**
 * The CCI connection hides the managed connection.
 * 
 */
public interface LegStarConnection extends Connection {

    /**
     * The underlying managed connection.
     * 
     * @return the underlying managed connection
     */
    public LegStarManagedConnection getManagedConnection();

    /**
     * The underlying managed connection.
     * 
     * @param managedConnection the underlying managed connection
     */
    public void setManagedConnection(LegStarManagedConnection managedConnection);

    /**
     * Mark this connection as invalid.
     */
    public void invalidate();

    /**
     * True if the connection is still valid.
     * 
     * @return false if connection was invalidated
     */
    public boolean isValid();

}
